#ifndef CODEGENAPP_H
#define CODEGENAPP_H

#include <QtGui/QMainWindow>
#include "ui_codegenapp.h"

class DClassEntity;
class DDocument;

class CodeGenApp : public QMainWindow
{
	Q_OBJECT

public:
	CodeGenApp(QWidget *parent = 0, Qt::WFlags flags = 0);
	~CodeGenApp();
private:
	QIcon createIcon(ClassType eType);
	Ui::CodeGenAppClass		ui;
	QTreeWidgetItem*		m_pSelectedItem;

	QUndoStack*				m_pUndoStack;
	DDocument*				m_pDoc;
private slots:
	void					onContextMenuRequest(const QPoint& pos);
	void					onItemDoubleClicked(QTreeWidgetItem * item, int column);
	void					onCreateBaseClass();
	void					onCreateDataClass();
	void					onCreateBLClass();
	void					onRemoveClass();

	void					onClassAdded(DClassEntity* pClass);
	void					onClassRemoved(DClassEntity* pClass);

	void					on_actionNew_triggered();
	void					on_actionLoad_triggered();
	void					on_actionSave_triggered();
	void					on_actionExit_triggered();
};

#endif // CODEGENAPP_H
